package com.wuseguang.springcloud.controller;


import com.wuseguang.springcloud.Filter.RequestParameterWrapper;
import com.wuseguang.springcloud.entity.RatingLimitsCustomized;
import com.wuseguang.springcloud.service.RatingLimitsCustomizedService;
import com.wuseguang.springcloud.util.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 教师评分限制-定制-浙江温州 前端控制器
 * </p>
 *
 * @author 
 * @since 2020-09-27
 */
@RestController
@RequestMapping("/ratingLimitsCustomized")
public class RatingLimitsCustomizedController {


    private Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private RatingLimitsCustomizedService ratingLimitsCustomizedServiceImpl;

    /**
     * 查询教师评分限制 - 温州定制
     * @param request
     * @return
     */
    @RequestMapping("/findRatingLimitsCustomized")
    public Result findRatingLimitsCustomized(RequestParameterWrapper request){
        logger.info("查询教师评分限制");
        //学校id
        String schoolId = request.getParam("schoolId");

        return ratingLimitsCustomizedServiceImpl.findRatingLimitsCustomized(schoolId);
    }

    /**
     * 添加教师评分限制
     * @param request
     * @return
     */
    @RequestMapping("/addRatingLimitsCustomized")
    public Result addRatingLimitsCustomized(RequestParameterWrapper request,@RequestBody List<RatingLimitsCustomized> list){
        logger.info("添加教师评分限制");
        //学校id
        String schoolId = request.getParam("schoolId");
        return ratingLimitsCustomizedServiceImpl.addRatingLimitsCustomized(list,schoolId);
    }

}

